home *** CD-ROM | disk | FTP | other *** search
- /*
- IXStoreDirectory.h
- Copyright 1991, NeXT Computer, Inc.
- */
-
- #import <objc/Object.h>
- #import <store/IXStoreFile.h>
-
- #ifdef NX_COMPILER_RELEASE_3_0
- @class IXBTreeCursor;
- #endif NX_COMPILER_RELEASE_3_0
-
- // This class implements a simple directory for managing store clients. The
- // store clients must conform to the IXBlockAndStoreAccess protocol. Any
- // object may be stored in an IXStoreDirectory, however, as long as it responds
- // to init and the archiving methods read: and write:.
-
- #ifdef NX_COMPILER_RELEASE_3_0
- @interface IXStoreDirectory: Object <IXNameAndFileAccess>
- #else NX_COMPILER_RELEASE_3_0
- @interface IXStoreDirectory: Object
- #endif NX_COMPILER_RELEASE_3_0
- {
- BOOL _freeStore;
- char *_handleName;
- unsigned _handle;
- IXStore *_store;
- #ifdef NX_COMPILER_RELEASE_3_0
- IXBTreeCursor *_btreeCursor;
- #else NX_COMPILER_RELEASE_3_0
- id _btreeCursor;
- #endif NX_COMPILER_RELEASE_3_0
- }
-
- // Returns the receiver's store, primarily as a convenience for transaction
- // management - e.g., [[client store] startTransaction].
-
- - (IXStore *)store;
-
- // These methods add new named entries to the directory. Any class may be
- // supplied, as long as the instances can be meaningfully initialized with the
- // init method and archived with NXWriteRootObject. If the class is a store
- // client, the instance will be initialized in the directory's store using the
- // initFromBlock:inStore: method.
-
- - addEntryNamed:(const char *)aName ofClass:aClass;
- - addEntryNamed:(const char *)aName ofClass:aClass atBlock:(unsigned)aHandle;
- - addEntryNamed:(const char *)aName forObject:anObject;
-
- // This method is obselete. Use entryNames instead.
- - (const char **)entries; // caller must free the array of entry names
-
- // Returns newline delimited string containing entry names; caller must free.
- - (const char *)entryNames;
-
- // These methods remove entries from the directory, but don't remove the
- // associated objects from the store. Use empty and freeEntryNamed: to free
- // the objects, as well as the entries.
-
- - reset; // removes all entries
- - removeName:(const char *)aName; // removes, but doesn't free entry object
-
- - empty; // frees all entries
- - freeEntryNamed:(const char *)aName; // removes and frees associated object
-
- // The first of these two methods is redundant. openEntryNamed simply returns
- // nil if passed an invalid name; otherwise, it returns the associated object.
-
- - (BOOL)hasEntryNamed:(const char *)aName;
- - openEntryNamed:(const char *)aName;
-
- - getBlock:(unsigned *)aBlock ofEntryNamed:(const char *)aName;
- - getClass:(Class *)aClass ofEntryNamed:(const char *)aName;
-
- @end
-